package com.woniuxy01;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-07-17 9:39
 */
public class Test05 {
    public static void main(String[] args) {
        //三个班，每个班有3个人，输入每个班学生的成绩，分别计算每个班的总分，平均分
        Scanner sc = new Scanner(System.in);
        int score, total=0, avg;
        for (int i = 1; i <= 3; i++) {
            //数据清零
            total = 0;
            for (int j = 1; j <= 3; j++) {
                System.out.println("输入第" + i + "个班，第" + j + "名学生成绩");
                score = sc.nextInt();
                total = total + score;
            }
            avg = total / 3;
            System.out.println("第"+i+"各班的成绩信息：");
            System.out.println("total=" + total);
            System.out.println("avg=" + avg);
        }

    }
}
